Skip to content

Upper case the console messages and stamp the banner (#98) - #99

Merged
mgrossmann merged 2 commits into
mainfrom
console-messages-uppercase-ufsd-banner
Aug 12, 2026
Merged

Upper case the console messages and stamp the banner (#98)#99
mgrossmann merged 2 commits into
mainfrom
console-messages-uppercase-ufsd-banner

Conversation

@mgrossmann

Copy link
Copy Markdown
Contributor

Closes #98.

Before / after

IST                                                SOLL
FTPD000I FTPD Server 1.0.0-dev starting            FTPD000I FTPD 1.0.0-DEV (CA2B42D) STARTING
FTPD000I FTPD was APF authorized via SVC 244       FTPD005I LIBC370 1.0.2-DEV (5C0DEEB)
FTPD003I STEPLIB is now APF authorized             FTPD004W RACINIT ENVIR=CREATE FAILED RC=28
FTPD004W RACINIT ENVIR=CREATE failed RC=28         FTPD054I LISTENING ON ANY PORT 2121
FTPD054I Listening for FTP connections on ...      FTPD001I FTPD 1.0.0-DEV READY
FTPD001I Server is READY

FTPD097I FTPD shutting down...                     FTPD098I FTPD SHUTTING DOWN
FTPD098I FTPD shutdown complete                    FTPD099I FTPD SHUTDOWN COMPLETE

Plus, only when the module was built from a tree with uncommitted tracked
changes (mirrors UFSD006W):

FTPD006W BUILT FROM A MODIFIED WORKING TREE

What changed

Build stamp. mbt bumped bf0e081 -> 8b8a2f0 (mbt#64, fast-forward) so
.mbt/buildstamp.h is generated. The banner now carries MBT_VERSION,
MBT_COMMIT and libc370_version(), so a deploy/relink mismatch cannot hide.
buildstamp.h is included per translation unit (ftpd.c, ftpd#con.c,
ftpd#cmd.c) and deliberately not from ftpd.h -- -MMD would otherwise make
a new commit rebuild every object. FTPD_VERSION / FTPD_VERSION_STR are gone;
FTPD_PRODUCT holds the name the STAT reply still needs.

Case. Every ftpd_log_wto() message is upper case; values (data set names,
VOLSERs, the banner text, every %s/%d) keep their original case.
ftpd_upcase() in ftpd#log.c handles the three strings that arrive lower case
at runtime -- it uses the libc370 toupper(), so the mapping is EBCDIC-correct.

Message IDs.

old new why
FTPD097I shutting down FTPD098I 098/099 shutdown pair as in UFSD
FTPD098I shutdown complete FTPD099I "
FTPD099E COM area not available FTPD090E matches UFSD090E; was sharing 099E
FTPD099E initialization failed FTPD091E was sharing 099E
FTPD090E unknown command / TRACE syntax FTPD021E matches UFSD's 020I/021E pair
FTPD005W SSLPROXY (x2) FTPD007W 005 is libc370, 006 is the dirty-tree warning

The two APF success messages are gone -- UFSD reports only the failure, and one
of them was a second FTPD000I competing with the banner. The warn-and-continue
behaviour on APF failure (FTPD003W) is unchanged.

/F FTPD,VERSION now repeats the banner identity (version, commit, libc370)
instead of a static string.

Out of scope

ftpd_session_reply() was not touched -- those are FTP protocol replies read by
clients, not console output -- nor ftpd_log(), which goes to SYSOUT.

Verification

  • Clean make under -Wall -Werror, no warnings.
  • Decoded the built load module from CP037 and listed every FTPDnnnX literal:
    all upper case, no duplicate IDs, LIBC370 1.0.2-dev (5c0deeb) linked in.
  • #if MBT_COMMIT_DIRTY checked both ways: FTPD006W is in the module while
    the tree carries the uncommitted submodule bump, and compiled out after the
    commit (MBT_COMMIT "ca2b42d", MBT_COMMIT_DIRTY 0).
  • doc/FTPD_RAKF_SETUP.md updated for the FTPD004I/FTPD004W wording.

The console output itself is unverified until the STC is restarted on the
target -- the checks above are on the built module, not a running server.

The operator console output was mixed case, named a version hardcoded in
ftpd.h, and reused message IDs for unrelated events.  All three are now
aligned with UFSD.

Build stamp.  Bump the mbt submodule to mbt#64 so .mbt/buildstamp.h is
generated, and use it for the banner:

    FTPD000I FTPD 1.0.0-DEV (CF14987) STARTING
    FTPD005I LIBC370 1.0.2-DEV (5C0DEEB)
    FTPD006W BUILT FROM A MODIFIED WORKING TREE
    ...
    FTPD001I FTPD 1.0.0-DEV READY

A deploy/relink mismatch -- sysroot says X, the STC runs Y -- can no
longer hide, and a build carrying uncommitted tracked changes says so
instead of passing itself off as the commit it was branched from.
buildstamp.h is included per translation unit (ftpd.c, ftpd#con.c,
ftpd#cmd.c) and deliberately not from ftpd.h: -MMD would otherwise make
a new commit rebuild every object.  FTPD_VERSION and FTPD_VERSION_STR
are gone; FTPD_PRODUCT holds the name the STAT reply still needs.

Case.  Every ftpd_log_wto() message is upper case; values -- data set
names, VOLSERs, the banner, every %s/%d substitution -- keep their
original case.  ftpd_upcase() (ftpd#log.c) handles the three strings
that arrive lower case at runtime: MBT_VERSION, MBT_COMMIT and
libc370_version().  It uses the libc370 toupper(), so the mapping is
EBCDIC-correct.

ftpd_session_reply() is untouched: those are FTP protocol replies read
by clients, not console output.  So is ftpd_log(), which goes to SYSOUT.

Message IDs.  Six were ambiguous or in the wrong slot:

    FTPD097I shutting down            -> FTPD098I
    FTPD098I shutdown complete        -> FTPD099I
    FTPD099E COM area not available   -> FTPD090E   (was sharing 099E)
    FTPD099E initialization failed    -> FTPD091E   (was sharing 099E)
    FTPD090E unknown command / TRACE  -> FTPD021E   (UFSD's 020I/021E pair)
    FTPD005W SSLPROXY (x2)            -> FTPD007W   (005 is libc370 now)

The two APF success messages are gone -- UFSD reports only the failure,
and one of them was a second FTPD000I competing with the banner.  The
warn-and-continue behaviour on APF failure (FTPD003W) is unchanged.

/F FTPD,VERSION now repeats the banner identity instead of a static
string, which is what an operator asking it after a deploy wants.
MCS prefixes every message from an unauthorized problem program with
'+'.  clib_apf_setup() ran inside initialize(), i.e. after the banner
had already gone out, so the startup showed one line marked up
differently from all the others:

    +FTPD000I FTPD Server 1.0.0-dev starting
     FTPD000I FTPD was APF authorized via SVC 244

Hoist the call into main() between __cibset() and the banner, which is
where UFSD has it.  The rc is carried past the banner rather than
reported at the call site: a failure is worth a line, but not one ahead
of the message saying which server is starting.  FTPD still warns and
continues where UFSD gives up -- that behaviour is unchanged.

initialize() no longer needs argc/argv and drops both parameters.
@mgrossmann

Copy link
Copy Markdown
Contributor Author

Follow-up in db28e70: the banner also had a + on it.

MCS prefixes every message from an unauthorized problem program with +, and
clib_apf_setup() ran inside initialize() — i.e. after the banner. The IST
log in #98 shows it within a single start:

+FTPD000I FTPD Server 1.0.0-dev starting        ← before clib_apf_setup
 FTPD000I FTPD was APF authorized via SVC 244   ← after, no +

The SOLL has no +, and UFSD gets that for free by ordering __gtcom
__cibsetclib_apf_setup → banner (ufsd.c:311-348). FTPD now does the
same. The rc is carried past the banner instead of being reported at the call
site, so FTPD003W stays after FTPD000I — a failure is worth a line, but
not one ahead of the message saying which server is starting. The
warn-and-continue behaviour on APF failure is unchanged.

initialize() no longer needs argc/argv and drops both parameters.

Also ran the test suites, since the mbt bump carries two test-infrastructure
commits (mbt#63 test link order, mbt#55 mvs = false):

TSTADR     ok  rc=0     29 pass / 0 fail
TSTDSN     ok  rc=0     43 pass / 0 fail
2 host test(s) | assertions: 72 PASS, 0 FAIL

@mgrossmann
mgrossmann merged commit 169cee2 into main Aug 12, 2026
1 of 2 checks passed
@mgrossmann
mgrossmann deleted the console-messages-uppercase-ufsd-banner branch August 12, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Console messages: upper case throughout, and align startup/shutdown with UFSD

1 participant